#include "HierarchyDeleter.h"

namespace editor_core {

	HierarchyDeleter::HierarchyDeleter() {}

	HierarchyDeleter::~HierarchyDeleter() {}

	void HierarchyDeleter::VisitEntity( IEntity* entity ) {
		m_entitiesToDelete.Add( entity );
	}

	void HierarchyDeleter::DeleteHierarchy() {
		for( int i = 0; i < m_entitiesToDelete.GetLength(); ++i )
			m_entitiesToDelete[i]->Delete();
	}

	void HierarchyDeleter::UndeleteHierarchy() {
		for( int i = m_entitiesToDelete.GetLength() - 1; i >= 0; --i )
			m_entitiesToDelete[i]->Undelete();
	}

}
